﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/AdminCP/Views/Shared/ViewMasterPage1.Master"
    Inherits="System.Web.Mvc.ViewPage<InfoTech.Mvc.LanTranh.MucVu.Models.LINHMUCModel>" %>

<%@ Import Namespace="InfoTech.LanTranh.MucVu.Service" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="content-box">
        <div class="content-box-header">
            <h3>
                Thêm Linh Mục</h3>
        </div>
        <!-- End .content-box-header -->
        <div class="content-box-content">
            <%
                Html.EnableClientValidation(); %>
            <% 
                using (Html.BeginForm())
                {%>
            <%: Html.ValidationSummary() %>
            <table cellpadding="3" cellspacing="3">
                <tr>
                    <td class="title" colspan="5">
                        Thông Tin Linh Mục
                    </td>
                </tr>
                <tr>
                    <td class="lineRow" colspan="5">
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Tên Thánh
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.TENTHANH, new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.TENTHANH, "(*)")%>
                        </div>
                    </td>
                    <td width="10">
                        &nbsp;
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Chức Vụ
                    </td>
                    <td>
                        <div class="editor-field">
                            <%:Html.DropDownListFor(c => c.MACHUCVU, LINHMUC_CHUCVUService.Get_List(), new { style = "width: 200px", @class = "text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.MACHUCVU, "(*)")%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Họ và Tên Đệm
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.HOVATENDEM, new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.HOVATENDEM, "(*)")%>
                        </div>
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        &nbsp;
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Tên
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.TEN, new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.TEN, "(*)")%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Ngày Sinh
                    </td>
                    <td colspan="4">
                        <table>
                            <tr>
                                <td>
                                    <div class="editor-field">
                                        <%: Html.DropDownListFor(model => model.NGAYSINH,GIAODANService.Get_List_Days(), new { style = "width: 140px", @class="text-input" })%>
                                        <%: Html.ValidationMessageFor(model => model.NGAYSINH, "(*)")%>
                                    </div>
                                </td>
                                <td>
                                    <div class="editor-field">
                                        <%: Html.DropDownListFor(model => model.THANGSINH,GIAODANService.Get_List_Months(), new { style = "width: 145px", @class="text-input" })%>
                                        <%: Html.ValidationMessageFor(model => model.NGAYSINH, "(*)")%>
                                    </div>
                                </td>
                                <td>
                                    <div class="editor-field">
                                        <%: Html.DropDownListFor(model => model.NAMSINH,GIAODANService.Get_List_Years(), new { style = "width: 135px", @class="text-input" })%>
                                        <%: Html.ValidationMessageFor(model => model.NGAYSINH, "(*)")%>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Địa Chỉ
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.DIACHI, new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.DIACHI, "(*)")%>
                        </div>
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        &nbsp;
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Điện Thoại
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.DIENTHOAI, new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.DIENTHOAI, "(*)")%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Email
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.EMAIL, new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.EMAIL, "(*)")%>
                        </div>
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        DTDĐ
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.MOBILE, new { style = "width: 250px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.MOBILE, "(*)")%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="lineRow" colspan="5">
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                    </td>
                    <td colspan="4">
                        <input type="submit" value="Thêm mới Linh Mục" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" />
                    </td>
                </tr>
            </table>
            <% } %>
        </div>
        <!-- End .content-box-content -->
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderCss" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderScript" runat="server">
    <script language="javascript" type="text/javascript">
        $(function () {
            $("#TENTHANH").autocomplete({
                    source: function( request, response ) {
				            $.ajax({
					                    url: "<%=Url.Action("DanhSachTenThanh","GiaDinhCongGiao") %>",
					                    dataType: "json",
					                    data: {						                      
						                    q: request.term
					                    },
					                    success: function( data ) {
						                    response( $.map( data, function( item ) {
							                    return {
								                    label: item.TENTHANH,
								                    value: item.TENTHANH
							                    }
						                    }));
					                    }
				            });
			        },
                    minLength: 0,
			        select: function( event, ui ) {
				        if(ui.item) {                            
                            $("#TENTHANH").val(ui.item.value);
                        }
			        },
			        open: function() {
                        selecting=true;
				        $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
			        },
			        close: function() {
				        $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
                        selecting=false;
			        }
		    });           
        });
    </script>
</asp:Content>
